package com.idc.resource.util;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 结果封装
 * Created by Lijing on 2017/6/1.
 */
@Getter
@Setter
@ToString
public class Result<T> implements Serializable {
    /** 响应是否成功 */
    private boolean success;
    /** 结果数据 */
    private T data;
    /** 错误码  */
    private String errorCode;
    /** 错误描述 */
    private String errorMsg;
    public Result() {
    }

    public Result(T data) {
        this.success = true;
        this.data = data;
    }

    public Result(String errorCode, String errorMsg) {
        this.success = false;
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

}
